package com.wb.mas.entity;

import android.content.Context;

import com.wb.mas.R;

import java.io.Serializable;

/**
 * Copyright (C) 2018,
 * OrderEntity
 * <p>
 * Description
 * 订单的实体类
 *
 * @author mwl
 * @version 1.0
 * <p>
 * Ver 1.0, 2019-04-30, mwl, Create file
 */
public class OrderListEntity implements Serializable {
    /**
     * "partialRepaymentMark": false, // 部分还款标识
     * "repayMoney": 0, // 应还金额
     * "orderId": "DKN19040200002", // 订单ID
     * "applyMoney": 800000, // 申请金额
     * "lastPayDate": "",// 上次还款时间？我不确定 不重要
     * "crtTime": "1554174844000", // 订单创建时间
     * "orderStatus": 1, // 订单状态
     * "productTerm": "9", // 产品周期
     * "approvalMoney": 0 // 批准金额
     */


    public boolean partialRepaymentMark;
    public String repayMoney;
    public String orderId;
    public String applyMoney;
    public String lastPayDate;
    public String crtTime;
    public int orderStatus;
    public String productTerm;
    public String approvalMoney;


    public String overdueDay; // 逾期天数
    public String overdueAmt; //  逾期费用

    public OrderListEntity() {
    }

    public boolean isPartialRepaymentMark() {
        return partialRepaymentMark;
    }

    public void setPartialRepaymentMark(boolean partialRepaymentMark) {
        this.partialRepaymentMark = partialRepaymentMark;
    }

    public String getRepayMoney() {
        return repayMoney;
    }

    public void setRepayMoney(String repayMoney) {
        this.repayMoney = repayMoney;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public String getApplyMoney() {
        return applyMoney;
    }

    public void setApplyMoney(String applyMoney) {
        this.applyMoney = applyMoney;
    }

    public String getLastPayDate() {
        return lastPayDate;
    }

    public void setLastPayDate(String lastPayDate) {
        this.lastPayDate = lastPayDate;
    }

    public String getCrtTime() {
        return crtTime;
    }

    public void setCrtTime(String crtTime) {
        this.crtTime = crtTime;
    }

    public int getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(int orderStatus) {
        this.orderStatus = orderStatus;
    }

    public String getProductTerm() {
        return productTerm;
    }

    public void setProductTerm(String productTerm) {
        this.productTerm = productTerm;
    }

    public String getApprovalMoney() {
        return approvalMoney;
    }

    public void setApprovalMoney(String approvalMoney) {
        this.approvalMoney = approvalMoney;
    }

    public String getOverdueDay() {
        return overdueDay;
    }

    public void setOverdueDay(String overdueDay) {
        this.overdueDay = overdueDay;
    }

    public String getOverdueAmt() {
        return overdueAmt;
    }

    public void setOverdueAmt(String overdueAmt) {
        this.overdueAmt = overdueAmt;
    }

    /**
     * 获取状态显示
     *
     * @param context
     * @return
     */
    public String getStatusShow(Context context) {
        switch (orderStatus) {
            case OrderStatus.STATUS_AUDIT:
                return context.getString(R.string.order_status_audit);
            case OrderStatus.STATUS_WAITLOAN:
                return context.getString(R.string.order_status_waitloan);
            case OrderStatus.STATUS_WAITREFUND:
                return context.getString(R.string.order_status_waitrefund);
            case OrderStatus.STATUS_REFUSEED:
                return context.getString(R.string.order_status_refuseed);
            case OrderStatus.STATUS_CLEARED:
                return context.getString(R.string.order_status_clear);
            case OrderStatus.STATUS_OVERDUE:
                return context.getString(R.string.order_status_overdue);
            case OrderStatus.STATUS_DEFER:
                return context.getString(R.string.order_status_defer);
            default:
                return "";
        }
    }


    public boolean isNoCompleteStatus(){
        if (orderStatus== OrderStatus.STATUS_AUDIT || orderStatus== OrderStatus.STATUS_WAITLOAN || orderStatus== OrderStatus.STATUS_WAITREFUND || orderStatus== OrderStatus.STATUS_OVERDUE || orderStatus== OrderStatus.STATUS_DEFER){
            return true;
        }else{
            return false;
        }
    }


    public static class OrderStatus {

        /**
         * 审核中
         **/
        public static final int STATUS_AUDIT = 1;

        /**
         * 待放款
         **/
        public static final int STATUS_WAITLOAN = 2;

        /**
         * 已放款,待还款
         **/
        public static final int STATUS_WAITREFUND = 3;

        /**
         * 已拒绝
         **/
        public static final int STATUS_REFUSEED = 4;

        /**
         * 已结清
         **/
        public static final int STATUS_CLEARED = 5;

        /**
         * 已逾期
         **/
        public static final int STATUS_OVERDUE = 6;

        /**
         * 已展期
         **/
        public static final int STATUS_DEFER = 7;


    }
}
